package com.xiaomaoaixue.postapi.api.domain;


/**
 * @description: 用户身份相关
 * @author: Xushu
 * @create: 2022年3月22日17:16:00
 **/
public class WeUserInfoVo {

    public WeUserInfoVo() {
    }

    /**
     * a) 当用户为企业成员时返回字段
     */
    private String userId;


    /**
     * b) 非企业成员时返回字段
     */

    //非企业成员的标识，对当前企业唯一。不超过64字节
    private String openId;


    //外部联系人id，当且仅当用户是企业的客户，且跟进人在应用的可见范围内时返回。如果是第三方应用调用，针对同一个客户，同一个服务商不同应用获取到的id相同
    private String externalUserId;


    //手机设备号(由企业微信在安装时随机生成，删除重装会改变，升级不受影响)
    private String deviceId;

    private WeUserInfoVo(Builder builder) {
        setUserId(builder.userId);
        setOpenId(builder.openId);
        setExternalUserId(builder.externalUserId);
        setDeviceId(builder.deviceId);
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getExternalUserId() {
        return externalUserId;
    }

    public void setExternalUserId(String externalUserId) {
        this.externalUserId = externalUserId;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }


    public static final class Builder {
        private String userId;
        private String openId;
        private String externalUserId;
        private String deviceId;

        public Builder() {
        }

        public Builder userId(String val) {
            userId = val;
            return this;
        }

        public Builder openId(String val) {
            openId = val;
            return this;
        }

        public Builder externalUserId(String val) {
            externalUserId = val;
            return this;
        }

        public Builder deviceId(String val) {
            deviceId = val;
            return this;
        }

        public WeUserInfoVo build() {
            return new WeUserInfoVo(this);
        }
    }
}
